﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DAL.Repositories;
using ggHD.Domain.BizObj;
using ggHD.Domain.Repisitories;
using LinqToDB;
using OpenPop.Mime;

namespace ggHD.DAL.Repositories
{
    internal class RawMailRepository:Repository<RawMail,long>,IRawMailRepository
    {
        public RawMailRepository(IDataContext context) : base(context)
        {
        }

        public Message GetAsMessage(long key)
        {
            var rawMail = Get(key);
            var msg = new Message(rawMail.RawData);
            return msg;
        }
        
    }
}
